home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 1 / Cream of the Crop 1.iso / PROGRAM / UUPC11QS.ARJ / HOSTABLE.H < prev    next >
C/C++ Source or Header  |  1991-11-05  |  4KB  |  95 lines

  1. /*
  2.    hostable.h
  3.  
  4.    routines included in hostable.c
  5.  
  6.    Copyright (c) 1989, 1990  Andrew H. Derbyshire
  7.  
  8.    Update History:
  9.  
  10.    18Mar90     Create from router.c                                  ahd
  11.  */
  12.  
  13. #ifndef __HOSTABLE
  14. #define __HOSTABLE
  15.  
  16. #ifndef __LIB
  17. #error Need "LIB.H"
  18. #endif
  19.  
  20. #define UUCPSHELL "uucp"         /* Shell for UUCP users                */
  21. #define ANONYMOUS_HOST "*anonymous" /* Anonymous systems                */
  22.  
  23. #define BADHOST NULL
  24.  
  25. #define HOSTLEN   8           /* max length of host name without '\0'   */
  26.  
  27. /*--------------------------------------------------------------------*/
  28. /*    Note in the following table that "fake" hosts must precede      */
  29. /*    "nocall" and "real" hosts must follow it.                       */
  30. /*--------------------------------------------------------------------*/
  31.  
  32. typedef enum
  33.                 { phantom,          /* Entry not fully initialized      */
  34.                   localhost,        /* This entry is for ourselves      */
  35.                   routed,           /* This entry is actually a path    */
  36.                   gatewayed,        /* This entry is delivered to via   */
  37.                                     /* an external program on local sys */
  38.                   aliasof,          /* This entry is alias of VIA system*/
  39.                   nocall,           /* real host, never called          */
  40.                   inprogress,       /* Call now active                  */
  41.                   callback_req,     /* System must call us back         */
  42.                   dial_failed,      /* Hardcoded auto-dial failed       */
  43.                   script_failed,    /* script in L.SYS failed           */
  44.                   max_retry,        /* Have given up calling this sys   */
  45.                   too_soon,         /* In retry mode, too soon to call  */
  46.                   succeeded,        /* self-explanatory                 */
  47.                   wrong_host,       /* Call out failed, wrong system    */
  48.                   unknown_host,     /* Call in cailed, unknown system   */
  49.                   wrong_time,       /* Unable to call because of time   */
  50.                   last_status }
  51.                         hostatus;
  52.  
  53. /*--------------------------------------------------------------------*/
  54. /*                          Status information                        */
  55. /*--------------------------------------------------------------------*/
  56.  
  57. struct HostStats {
  58.       time_t ltime;              /* Last time this host was called      */
  59.       time_t lconnect;           /* Last time we actually connected     */
  60.       unsigned long calls;       /* Total number of calls to host       */
  61.       unsigned long connect;     /* Total length of connections to host */
  62.       unsigned long fsent;       /* Total files sent to this host       */
  63.       unsigned long freceived;   /* Total files received from this host */
  64.       unsigned long bsent;       /* Total bytes sent to this host       */
  65.       unsigned long breceived;   /* Total bytes received from this host */
  66.       unsigned long errors;      /* Total transmission errors noted     */
  67.       unsigned long packets;     /* Total packets exchanged             */
  68.       hostatus save_hstatus;     /* host status, as defined by hostatus */
  69.    };
  70.  
  71. /*--------------------------------------------------------------------*/
  72. /*                          Master hostable                           */
  73. /*--------------------------------------------------------------------*/
  74.  
  75. struct  HostTable {
  76.       char  *hostname;           /* Name of the host in question        */
  77.       char  *via;                /* Host hostname is routed via         */
  78.       struct HostStats *hstats;  /* Point to stats for real hosts only  */
  79.       struct HostSecurity *hsecure; /* Security Information, real hosts
  80.                                        only                             */
  81.       boolean called;            /* Whether this host was connected     */
  82.                                  /* during this execution of UUIO       */
  83.       hostatus hstatus;          /* host status, as defined by hostatus */
  84.    };
  85.  
  86. struct HostTable *searchname(const char *name, const size_t namel);
  87.  
  88. struct HostTable *checkname(const char *name);
  89.  
  90. struct HostTable *checkreal(const char *name);
  91.  
  92. struct HostTable *nexthost( const boolean start , const hostatus status );
  93.  
  94. #endif
  95.